﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace PacoToolKit.Log
{
    public class Common
    {
        /// <summary>
        /// 调试日志
        /// </summary>
        /// <param name="msg"></param>
        public static void TraceLog(String msg)
        {
            if (!System.IO.File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + "/TraceLog.txt"))
                System.IO.File.Create(System.AppDomain.CurrentDomain.BaseDirectory + "/TraceLog.txt");
            using (StreamWriter writer = new StreamWriter(System.AppDomain.CurrentDomain.BaseDirectory + "/TraceLog.txt", true, System.Text.Encoding.UTF8))
            {
                writer.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\t" + msg);
            }
        }
    }
}
